CREATE TABLE [dbo].[TCFACT_CIER]
(
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANNO] NOT NULL CONSTRAINT [DF__TCFACT_CI__NU_AN__3D5E1FD2] DEFAULT (datepart(year,getdate())),
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[FA_CAMB_VNTA] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TCFACT_CI__FA_CA__403A8C7D] DEFAULT ((1.000)),
[FA_CAMB_CMPR] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TCFACT_CI__FA_CA__4222D4EF] DEFAULT ((1.000)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCFACT_CI__FE_US__440B1D61] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCFACT_CI__FE_US__44FF419A] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCFACT_CIER] ADD CONSTRAINT [CK__TCFACT_CI__FA_CA__412EB0B6] CHECK (([FA_CAMB_VNTA]>=(0)))
GO
ALTER TABLE [dbo].[TCFACT_CIER] ADD CONSTRAINT [CK__TCFACT_CI__FA_CA__4316F928] CHECK (([FA_CAMB_CMPR]>=(0)))
GO
ALTER TABLE [dbo].[TCFACT_CIER] ADD CONSTRAINT [CK__TCFACT_CI__NU_AN__3E52440B] CHECK (([NU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TCFACT_CIER] ADD CONSTRAINT [CK__TCFACT_CI__NU_ME__3F466844] CHECK (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TCFACT_CIER] ADD CONSTRAINT [XPKTCFACT_CIER] PRIMARY KEY CLUSTERED  ([CO_MONE], [NU_ANNO], [NU_MESE]) ON [PRIMARY]
GO
